(function() {
  app.controller('change_pswCtrl', function($window, $rootScope, $scope, $state, tradeApi,centerdilog, $timeout, alertTip, header_m) {
    $scope.client = {};
    header_m
      .set({
        txt_r: '保存',
        fun_r: function() {
          centerdilog
            .open({
              msg: '确定修改密码？',
              ok: $scope.ok,
            });
        },
      });

    $scope.ok = function() {
      tradeApi
        .query({
          funcId: '300009',
          data: $scope.client
        })
        .then(function(res) {
          alertTip.open({
            msg: '密码修改成功',
            state: 1,
          });
          $timeout(function() {
            $window.history.back();
          }, 1000);
        });
    };
  });
})();
